﻿using System;
using System.Collections.Generic;
using Framework;
using Framework.Dependency;
using Interfaces.Criteria;
using Interfaces.Filters;
using Interfaces.Models;
using Interfaces.Providers;
using Microsoft.Practices.Unity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using YQLDataProvider;
using YQLDataProvider.Providers;
using FlurentFiltration;

namespace FrameworkUnitTests
{
    [TestClass]
    public class DependencyManagerTests
    {
        [TestMethod]
        public void TestLoadConfiguration_FactoryResolved()
        {
            DependencyManager.Container.RegisterType<ISettingsFactory, SettingsFactory>();
            var factory = DependencyManager.Container.Resolve<ISettingsFactory>();
           Assert.IsNotNull(factory);
        }

        [TestMethod]
        public void TestGenericInterfaceResolver_IIndustrySectorInterfaceResolved()
        {
            DependencyManager.Container.RegisterType<ISettingsFactory, SettingsFactory>();
            DependencyManager.Container.RegisterType
                <IEconomicDataProvider<IEnumerable<IIndustrySector>, ISectorsFilter, IBaseCriteria>,YqlIndustrySectorsDataProvider>();
            var provider = DependencyManager.Container.Resolve<IEconomicDataProvider<IEnumerable<IIndustrySector>, ISectorsFilter, IBaseCriteria>>();
            Assert.IsNotNull(provider);
        }
    }
}
